package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 人员操作日志表
 * @TableName t_system_running
 */
@Data
public class SystemRunning implements Serializable {
    /**
     * 人员操作日志编号
     */
    private Integer srId;

    /**
     * 类名
     */
    private String srClassName;

    /**
     * 方法名
     */
    private String srMethodName;

    /**
     * 操作者
     */
    private String srOperator;

    /**
     * 操作时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date srOperateTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SystemRunning other = (SystemRunning) that;
        return (this.getSrId() == null ? other.getSrId() == null : this.getSrId().equals(other.getSrId()))
            && (this.getSrClassName() == null ? other.getSrClassName() == null : this.getSrClassName().equals(other.getSrClassName()))
            && (this.getSrMethodName() == null ? other.getSrMethodName() == null : this.getSrMethodName().equals(other.getSrMethodName()))
            && (this.getSrOperator() == null ? other.getSrOperator() == null : this.getSrOperator().equals(other.getSrOperator()))
            && (this.getSrOperateTime() == null ? other.getSrOperateTime() == null : this.getSrOperateTime().equals(other.getSrOperateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSrId() == null) ? 0 : getSrId().hashCode());
        result = prime * result + ((getSrClassName() == null) ? 0 : getSrClassName().hashCode());
        result = prime * result + ((getSrMethodName() == null) ? 0 : getSrMethodName().hashCode());
        result = prime * result + ((getSrOperator() == null) ? 0 : getSrOperator().hashCode());
        result = prime * result + ((getSrOperateTime() == null) ? 0 : getSrOperateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", srId=").append(srId);
        sb.append(", srClassName=").append(srClassName);
        sb.append(", srMethodName=").append(srMethodName);
        sb.append(", srOperator=").append(srOperator);
        sb.append(", srOperateTime=").append(srOperateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}